# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=ansible-lint
pkgver=4.2.0
pkgrel=0
pkgdesc="A tool to check ansible playbooks"
url="https://github.com/ansible/ansible-lint"
arch="noarch"
license="MIT"
depends="ansible py3-yaml py3-six py3-ruamel.yaml py3-setuptools"
checkdepends="py3-pytest py3-pytest-cov"
makedepends="py3-pip"
source="https://files.pythonhosted.org/packages/source/a/ansible-lint/ansible-lint-$pkgver.tar.gz
	10-python3-shebang.patch
	"
provides="py3-ansible-lint=$pkgver-r$pkgrel" # for backward compatibility
replaces="py3-ansible-lint" # for backward compatibility

build() {
	python3 -c "from setuptools import setup; setup();" build
}

check() {
	export PYTHONPATH="$builddir/build/lib"
	python3 -m pytest
}

package() {
	python3 -c "from setuptools import setup; setup();" \
		install --prefix=/usr --root="$pkgdir"
}

sha512sums="1f870708771fa7cacc0796483866640015aac290b6c65cb5b50b68517be9dbf6d18127f9636cfd45d0daa37d96fc206068ed70611d56f348e1ae9f3e0ff498a2  ansible-lint-4.2.0.tar.gz
4a8dbbc51f686985ba857aff4063c8f2078af4d9b4134d799017cca958d85e59e0f9985f8e1bb16c6e1110f2586119d33c31364e31722b343de15376e4a8dd2d  10-python3-shebang.patch"
